package com.hornsun.member.API;

import com.hornsun.domain.dbo.Customer;
import org.springframework.web.bind.annotation.*;

import java.util.UUID;

/**
 * Created by 编译中... on 2018/1/27.
 */
@RestController
@RequestMapping("api/customer")
public class MemberAPI {

    /**
     * 新增顾客
     * @param customer
     */
    @PostMapping("/addCustomer")
    public void addCustomer(@RequestParam Customer customer){
        customer.setCustomerGuid(UUID.randomUUID().toString());


    }

    /**
     * 修改顾客信息
     *
     * @param customer
     */
    @PostMapping("/updateCustomer")
    public void updateCustomer(@RequestParam Customer customer){

    }

    /**
     * 删除顾客
     */
    @PostMapping("/deleteCustomer")
    public void deleteCustomer(){

    }

    /**
     * 查询顾客
     * 使用正则解析参数，若是电话号码则精确查询，若是顾客名则返回所有此名字的用户
     * @param info
     * @return
     */
    @GetMapping("/queryCustomer")
    public Customer queryCustomer(@RequestParam String info){
        return null;
    }

}
